<?php

class InterceptorPlugin extends Yaf_Plugin_Abstract{
    
    public function routerShutdown(Yaf_Request_Abstract $request,Yaf_Response_Abstract $response ){
        if (!($request->getControllerName()=='Index'&&$request->getActionName()=='user'))
        {
           if (!isset($_SESSION['user']) || $_SESSION['user']=='')
           {
               $request->setControllerName('Index');
               $request->setActionName('login');
           }
        }
    }
  
}
?>
